<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/7
 * Time: 14:30
 */

namespace app\modules\backed\controllers;


use app\models\UploadForm;
use yii\web\UploadedFile;

class UploadController extends BaseController
{
    public function actionOne()
    {
        $model = new UploadForm();

        if (\Yii::$app->request->isPost) {
            $model->imageFile = UploadedFile::getInstance($model, 'imageFile');
            if ($model->upload()) {
                // 文件上传成功
                return;
            }
        }

        return $this->render('one', ['model' => $model]);
    }
}